package com.tongji.diy.model
{
	import com.tongji.diy.model.furniturePlacementOptimization.BlockLayoutConstructor;
	import com.tongji.diy.model.furniturePlacementOptimization.DataAndFunction;
	import com.tongji.diy.model.furniturePlacementOptimization.assembleComplement.NoAccessibleFurniture;
	import com.tongji.diy.model.furniturePlacementOptimization.assembleComplement.SLbase;
	

	public class NoAccessAssignment
	{
		private var _blockLayOutBlock:Vector.<BlockLayoutConstructor>;
		private var _noAccessibleList:Vector.<NoAccessibleFurniture>;
		private var _SLlist:Vector.<SLbase> = new Vector.<SLbase>;
		private var data:DataAndFunction;
		public function NoAccessAssignment(blockLayOutBlock:Vector.<BlockLayoutConstructor>, noAccessibleList:Vector.<NoAccessibleFurniture>)
		{
			this._blockLayOutBlock = blockLayOutBlock;
			_noAccessibleList = noAccessibleList;
			this.data = this._blockLayOutBlock[0].data;
			main();
		}
		
		private function main():void
		{
			buildSLlist();
			for(var i:int = 0; i < this._noAccessibleList.length; ++i)
			{
				_noAccessibleList[i].arrange(this._SLlist,data);
			}
		}
		
		private function buildSLlist():void
		{
			for(var i:int = 0; i < this._blockLayOutBlock.length; ++i)
			{
				for(var j:int = 0;j < this._blockLayOutBlock[i].data._seatList.length; ++j)
					this._SLlist.push(this._blockLayOutBlock[i].data._seatList[j] as SLbase);
				
				for(j= 0;j < this._blockLayOutBlock[i].data._beddingList.length; ++j)
					this._SLlist.push(this._blockLayOutBlock[i].data._beddingList[j] as SLbase);
			}
		}
	}
}